package edu.gdkm.test;

import edu.gdkm.service.ProductService;
import edu.gdkm.sql.pojo.Product;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=edu.gdkm.config.SpringConfig.class)
public class ProductTest2 {
    @Autowired
    ProductService productService;
    @Test
    public void ProductTest(){
        System.out.println(productService.showProduct("华为mate10"));
    }
    @Test
    public void insertProduct(){
        Product product=new Product();
        product.setGoodsname("hh");
        product.setPrice(2333);
        product.setTypeid(2);
        productService.insertProduct(product);
    }
}
